<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><script type="text/javascript" src="https://cdn.jsdelivr.net/gh/opencobra/cobratoolbox@ffa0229fc0c01c9236bb7e961f65712443277719/latest/_static/js/iframeResizer.contentWindow.min.js"></script><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge,IE=9,chrome=1"><meta name="generator" content="MATLAB 2021a"><title>Robust Metabolic Transformation Analysis - rMTA</title><style type="text/css">.rtcContent { padding: 30px; } .S0 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 28.8px; min-height: 0px; white-space: normal; color: rgb(213, 80, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 24px; font-weight: normal; text-align: left;  }
.S1 { margin: 20px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;  }
.S2 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: left;  }
.S3 { margin: 2px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: center;  }
.CodeBlock { background-color: #F7F7F7; margin: 10px 0 10px 0;}
.S4 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 0px none rgb(0, 0, 0); border-radius: 4px 4px 0px 0px; padding: 6px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S5 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 0px none rgb(0, 0, 0); border-radius: 0px; padding: 0px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S6 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px; padding: 0px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S7 { color: rgb(64, 64, 64); padding: 10px 0px 6px 17px; background: rgb(255, 255, 255) none repeat scroll 0% 0% / auto padding-box border-box; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px; overflow-x: hidden; line-height: 17.234px;  }
/* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsErrorElement {    min-height: 18px;    max-height: 250px;    overflow: auto;}
.embeddedOutputsErrorElement.inlineElement {}
.embeddedOutputsErrorElement.rightPaneElement {}
/* Styling that is common to warnings and errors is in diagnosticOutput.css */.embeddedOutputsWarningElement{    min-height: 18px;    max-height: 250px;    overflow: auto;}
.embeddedOutputsWarningElement.inlineElement {}
.embeddedOutputsWarningElement.rightPaneElement {}
/* Copyright 2015-2019 The MathWorks, Inc. *//* In this file, styles are not scoped to rtcContainer since they could be in the Dojo Tooltip */.diagnosticMessage-wrapper {    font-family: Menlo, Monaco, Consolas, "Courier New", monospace;    font-size: 12px;}
.diagnosticMessage-wrapper.diagnosticMessage-warningType {    color: rgb(255,100,0);}
.diagnosticMessage-wrapper.diagnosticMessage-warningType a {    color: rgb(255,100,0);    text-decoration: underline;}
.diagnosticMessage-wrapper.diagnosticMessage-errorType {    color: rgb(230,0,0);}
.diagnosticMessage-wrapper.diagnosticMessage-errorType a {    color: rgb(230,0,0);    text-decoration: underline;}
.diagnosticMessage-wrapper .diagnosticMessage-messagePart,.diagnosticMessage-wrapper .diagnosticMessage-causePart {    white-space: normal;}
.diagnosticMessage-wrapper .diagnosticMessage-stackPart {    white-space: normal;}
.embeddedOutputsTextElement,.embeddedOutputsVariableStringElement {    white-space: normal;    word-wrap:  initial;    min-height: 18px;    max-height: 250px;    overflow: auto;}
.textElement,.rtcDataTipElement .textElement {    padding-top: 3px;}
.embeddedOutputsTextElement.inlineElement,.embeddedOutputsVariableStringElement.inlineElement {}
.inlineElement .textElement {}
.embeddedOutputsTextElement.rightPaneElement,.embeddedOutputsVariableStringElement.rightPaneElement {    min-height: 16px;}
.rightPaneElement .textElement {    padding-top: 2px;    padding-left: 9px;}
.S8 { margin: 10px 10px 9px 4px; padding: 0px; line-height: 21px; min-height: 0px; white-space: normal; color: rgb(0, 0, 0); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 14px; font-weight: normal; text-align: left;  }
.S9 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 4px 4px 0px 0px; padding: 6px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S10 { margin: 3px 10px 5px 4px; padding: 0px; line-height: 20px; min-height: 0px; white-space: normal; color: rgb(60, 60, 60); font-family: Helvetica, Arial, sans-serif; font-style: normal; font-size: 20px; font-weight: bold; text-align: left;  }
.S11 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 0px none rgb(0, 0, 0); border-radius: 0px; padding: 6px 45px 0px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.embeddedOutputsVariableTableElement .ClientViewDiv  table tr {  height: 22px;  white-space: nowrap;}
.embeddedOutputsVariableTableElement .ClientViewDiv  table tr td,.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {  background-color:white;  text-overflow: ellipsis;  font-family: 'Arial', sans-serif;  font-size: 12px;  overflow : hidden;}
.embeddedOutputsVariableTableElement .ClientViewDiv  table tr span {  text-overflow: ellipsis;  padding: 3px;}
.embeddedOutputsVariableTableElement .ClientViewDiv  table tr th {    color: rgba(0,0,0,0.5);  padding: 3px;  font-size: 9px;}
.S12 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 0px none rgb(0, 0, 0); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px 0px 4px 4px; padding: 0px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S13 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 4px; padding: 6px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S14 { border-left: 1px solid rgb(233, 233, 233); border-right: 1px solid rgb(233, 233, 233); border-top: 1px solid rgb(233, 233, 233); border-bottom: 1px solid rgb(233, 233, 233); border-radius: 0px; padding: 6px 45px 4px 13px; line-height: 17.234px; min-height: 18px; white-space: nowrap; color: rgb(0, 0, 0); font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 14px;  }
.S15 { margin: 10px 0px 20px; padding-left: 0px; font-family: Helvetica, Arial, sans-serif; font-size: 14px;  }
.S16 { margin-left: 56px; line-height: 21px; min-height: 0px; text-align: left; white-space: normal;  }</style></head><body><div class = rtcContent><h1  class = 'S0'><span style=' font-weight: bold;'>Robust Metabolic Transformation Analysis - rMTA</span></h1><h2  class = 'S1'><span>Luis V. Valcarcel, University of Navarra, TECNUN School of Engineering, Spain</span></h2><h2  class = 'S1'><span>Francisco J. Planes, University of Navarra, TECNUN School of Engineering, Spain</span></h2><h2  class = 'S1'><span>Reviewer(s): </span></h2><h2  class = 'S1'><span>INTRODUCTION</span></h2><div  class = 'S2'><span>Metabolic Transformation Algorithm (MTA) [1] aims to identify targets that transform a disease metabolic state back  into a healthy state, with potential application in any disease where a  clear metabolic alteration is observed.</span></div><div  class = 'S2'><span>Robust Metabolic Transformation Algorithm (rMTA) [2] is the natural evolution of such an algorithm, removing the induced bias and studying all the possible outputs of metabolic perturbations; to discover how easy is for a perturbation to drive the metabolism into target or in the opposite direction. This can be seen in Figure 1. Our desired case is (</span><span style=' font-weight: bold;'>Figure 1A</span><span>), in which MTA  and MTA targeting the opposte direction can only drive the metabolism into the desired direction. This is produced when the Transformation Scores (TSs) after gene knockout are skewed to the healthy direction in both the best-case (bTS) and worst-case scenario (wTS); (</span><span style=' font-weight: bold;'>Figure 1B</span><span>) TSs are similar in value and skewed to the opposite direction in the best-case and worst-case scenario and, therefore, under-determination arises; (</span><span style=' font-weight: bold;'>Figure 1C</span><span>) The same as (</span><span style=' font-weight: bold;'>Figure 1B</span><span>), but TS is higher in the best-case scenario and skewed to the healthy direction when MOMA is applied (mTS &gt; 0). Under-determination is resolved here using mTS (MOMA TS), which generates the perturbation without any prior knowledge of the desired flux change direction.</span></div><div  class = 'S3'><img class = "imageNode" src = "" width = "520" height = "313" alt = "" style = "vertical-align: baseline"></img></div><div  class = 'S2'><span style=' font-weight: bold;'>Figure 1. Illustration of the problem addressed by rMTA</span><span>. </span></div><div  class = 'S2'><span>In order to show the use of the tool, we are going to use data from controlled gene knockout (</span><span style=' font-style: italic;'>RRM1</span><span>) experiment in a human cell line with RPMI cultture media. The experiment reference is GSE9345 [3]. In such experiment, we are going to predict that </span><span style=' font-style: italic;'>RRM1</span><span> drives the source state(WT) into the target (RRM1-knockout) state. This case is shown in table 2 of the rMTA article.</span></div><h2  class = 'S1'><span>EQUIPMENT SETUP</span></h2><h2  class = 'S1'><span>Initialize The Cobra Toolbox and select the solver (~25 sec)</span></h2><div  class = 'S2'><span>If necessary, initialise the Cobra Toolbox:</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >clear</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >initCobraToolbox(false) </span><span style="color: rgb(2, 128, 9);">% false, as we don't want to update</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="C674A837" data-testid="output_0" data-width="420" data-height="829" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">      _____   _____   _____   _____     _____     |
     /  ___| /  _  \ |  _  \ |  _  \   / ___ \    |   COnstraint-Based Reconstruction and Analysis
     | |     | | | | | |_| | | |_| |  | |___| |   |   The COBRA Toolbox - 2021
     | |     | | | | |  _  { |  _  /  |  ___  |   |
     | |___  | |_| | | |_| | | | \ \  | |   | |   |   Documentation:
     \_____| \_____/ |_____/ |_|  \_\ |_|   |_|   |   <a href="http://opencobra.github.io/cobratoolbox" style="white-space: normal; font-style: normal; color: rgb(0, 95, 206); font-size: 12px;">http://opencobra.github.io/cobratoolbox</a>
                                                  | 

 &gt; Checking if git is installed ...  Done (version: 2.13.3).
 &gt; Checking if the repository is tracked using git ...  Done.
 &gt; Checking if curl is installed ...  Done.
 &gt; Checking if remote can be reached ...  Done.
 &gt; Initializing and updating submodules (this may take a while)... Done.
 &gt; Adding all the files of The COBRA Toolbox ...  Done.
 &gt; Define CB map output... set to svg.
 &gt; TranslateSBML is installed and working properly.
 &gt; Configuring solver environment variables ...
   - [*---] ILOG_CPLEX_PATH: C:\Program Files\ibm\ILOG\CPLEX_Studio1210\cplex\matlab\x64_win64
   - [*---] GUROBI_PATH: C:\gurobi911\win64\matlab
   - [----] TOMLAB_PATH: --&gt; set this path manually after installing the solver ( see <a href="https://opencobra.github.io/cobratoolbox/docs/solvers.html" style="white-space: normal; font-style: normal; color: rgb(0, 95, 206); font-size: 12px;">instructions</a> )
   - [----] MOSEK_PATH: --&gt; set this path manually after installing the solver ( see <a href="https://opencobra.github.io/cobratoolbox/docs/solvers.html" style="white-space: normal; font-style: normal; color: rgb(0, 95, 206); font-size: 12px;">instructions</a> )
   Done.
 &gt; Checking available solvers and solver interfaces ... Done.
 &gt; Setting default solvers ... Done.
 &gt; Saving the MATLAB path ... Done.
   - The MATLAB path was saved in the default location.

 &gt; Summary of available solvers and solver interfaces

					Support           LP 	 MILP 	   QP 	 MIQP 	  NLP 	   EP
	------------------------------------------------------------------------------
	gurobi       	active        	    1 	    1 	    1 	    1 	    - 	    -
	ibm_cplex    	active        	    1 	    1 	    1 	    1 	    - 	    -
	tomlab_cplex 	active        	    0 	    0 	    0 	    0 	    - 	    -
	glpk         	active        	    1 	    1 	    - 	    - 	    - 	    -
	mosek        	active        	    0 	    - 	    0 	    - 	    - 	    0
	matlab       	active        	    1 	    - 	    - 	    - 	    1 	    -
	pdco         	active        	    1 	    - 	    1 	    - 	    - 	    1
	quadMinos    	active        	    0 	    - 	    - 	    - 	    - 	    -
	dqqMinos     	active        	    0 	    - 	    0 	    - 	    - 	    -
	cplex_direct 	active        	    0 	    0 	    0 	    - 	    - 	    -
	cplexlp      	active        	    1 	    - 	    - 	    - 	    - 	    -
	qpng         	passive       	    - 	    - 	    1 	    - 	    - 	    -
	tomlab_snopt 	passive       	    - 	    - 	    - 	    - 	    0 	    -
	lp_solve     	legacy        	    1 	    - 	    - 	    - 	    - 	    -
	------------------------------------------------------------------------------
	Total        	-             	    7 	    3 	    4 	    2 	    1 	    1

 + Legend: - = not applicable, 0 = solver not compatible or not installed, 1 = solver installed.


 &gt; You can solve LP problems using: 'gurobi' - 'ibm_cplex' - 'glpk' - 'matlab' - 'pdco' - 'cplexlp' 
 &gt; You can solve MILP problems using: 'gurobi' - 'ibm_cplex' - 'glpk' 
 &gt; You can solve QP problems using: 'gurobi' - 'ibm_cplex' - 'pdco' 
 &gt; You can solve MIQP problems using: 'gurobi' - 'ibm_cplex' 
 &gt; You can solve NLP problems using: 'matlab' 
 &gt; You can solve EP problems using: 'pdco' 

&gt; Checking for available updates ... skipped</div></div></div></div></div><div  class = 'S8'><span>Note that the approaches to calculate MTA and rMTA scores it is necessary to solve problems that are based on Mixed Integer Quadratic Programming (MIQP). The solver selected will be Cplex, althought it has also been tested with gurobi.</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S9'><span style="white-space: normal"><span >changeCobraSolver(</span><span style="color: rgb(170, 4, 249);">'ibm_cplex'</span><span >, </span><span style="color: rgb(170, 4, 249);">'all'</span><span >);</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="CB200A94" data-testid="output_1" data-width="420" data-height="241" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"> &gt; changeCobraSolver: IBM ILOG CPLEX interface added to MATLAB path.
 &gt; The solver compatibility is not tested with MATLAB R2018b.
 &gt; changeCobraSolver: Solver for LP problems has been set to ibm_cplex.

 &gt; changeCobraSolver: IBM ILOG CPLEX interface added to MATLAB path.
 &gt; The solver compatibility is not tested with MATLAB R2018b.
 &gt; changeCobraSolver: Solver for MILP problems has been set to ibm_cplex.

 &gt; changeCobraSolver: IBM ILOG CPLEX interface added to MATLAB path.
 &gt; The solver compatibility is not tested with MATLAB R2018b.
 &gt; changeCobraSolver: Solver for QP problems has been set to ibm_cplex.

 &gt; changeCobraSolver: IBM ILOG CPLEX interface added to MATLAB path.
 &gt; The solver compatibility is not tested with MATLAB R2018b.
 &gt; changeCobraSolver: Solver for MIQP problems has been set to ibm_cplex.
 &gt; changeCobraSolver: Solver ibm_cplex not supported for problems of type EP. No solver set for this problemtype 
 &gt; changeCobraSolver: Solver ibm_cplex not supported for problems of type NLP. Currently used: matlab </div></div></div></div></div><h2  class = 'S10'><span>STEP 1: load the information to generate the reference flux</span></h2><div  class = 'S2'><span>The first step of rMTA algorithm is the reconstruction of the model for a specific tissue and sample the feasible flux space to calculate a reference flux. </span></div><div  class = 'S2'><span>For this study we have used Recon1, using the RPMI-1640 culture media. We have used FVA to find all blocked reactions and remove them.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >filename_metabolic_model = </span><span style="color: rgb(170, 4, 249);">'Recon1_RPMI1640_FVA.mat'</span><span >;</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >model = readCbModel(fullfile(</span><span style="color: rgb(170, 4, 249);">'Data'</span><span >,filename_metabolic_model))</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="EC1C533A" data-testid="output_2" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">Each model.subSystems{x} has been changed to a character array.</div></div><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="AB4AB857" data-testid="output_3" data-width="420" data-height="468" data-hashorizontaloverflow="false" style="width: 450px; max-height: 479px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">model = <span class="headerElement" style="white-space: normal; font-style: italic; color: rgb(179, 179, 179); font-size: 12px;">struct with fields:</span></span></div><div style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">                      S: [1239×1913 double]
                   mets: {1239×1 cell}
                      b: [1239×1 double]
                 csense: [1239×1 char]
                   rxns: {1913×1 cell}
                     lb: [1913×1 double]
                     ub: [1913×1 double]
                      c: [1913×1 double]
              osenseStr: 'max'
                  genes: {1905×1 cell}
                  rules: {1913×1 cell}
              metKEGGID: {1239×1 cell}
                grRules: {1913×1 cell}
             rxnGeneMat: [1913×1905 double]
    rxnConfidenceScores: [1913×1 double]
             subSystems: {1913×1 cell}
            description: 'Recon1_RPMI1640_FVA.mat'
                modelID: 'Network'
                      C: [0×1913 double]
                   ctrs: {0×1 cell}
                      d: [0×1 double]
                 dsense: [0×1 char]
                ChEBIID: {1239×1 cell}
              ECNumbers: {1913×1 cell}
            InChIString: {1239×1 cell}
              PubChemID: {1239×1 cell}
                 charge: [1239×1 int32]
                formula: {1239×1 cell}
                   name: {1239×1 cell}
                  notes: {1913×1 cell}
             references: {1913×1 cell}
                  rever: [1913×1 double]
</div></div></div></div></div><div class="inlineWrapper"><div  class = 'S11'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% transcript separator: there are some models (as Recon X) in which genes are</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% used at transcript level, not in gene level. Transcript separator is a variable</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% to join all transcripts of the gene and work at gene level.</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >transcript_separator = </span><span style="color: rgb(170, 4, 249);">'.'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'\tMetabolic model uploaded\n'</span><span >);</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="9BEBE9C4" data-testid="output_4" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">	Metabolic model uploaded</div></div></div></div></div><div  class = 'S8'><span>Then we import the gene expression data and reconstruct the model, using iMAT. This data has been obtaind in R using GEO accesion tools and performing the data preprocessing proposed for the Affymetrix Human Genome U133A 2.0 Array, using ARIMA, and the discretization into Highly , medium or lowly expressed proposed by the authors of iMAT[4]. This is explained in detail in the rMTA article in detail [2].</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >filename_onmics = </span><span style="color: rgb(170, 4, 249);">'GSE93425_Recon1_discret_iMAT_07_100.txt'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >onmic_data = readtable([</span><span style="color: rgb(170, 4, 249);">'Data'</span><span >,filesep,filename_onmics],</span><span style="color: rgb(170, 4, 249);">'ReadVariableNames'</span><span >,true);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Traduce onmic data from gene level to reaction level</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >aux_table = table(strtok(model.genes,transcript_separator),model.genes,</span><span style="color: rgb(170, 4, 249);">'VariableNames'</span><span >,{</span><span style="color: rgb(170, 4, 249);">'ENTREZ_ID' 'transcript'</span><span >});</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >onmic_data = outerjoin(aux_table, onmic_data, </span><span style="color: rgb(170, 4, 249);">'Keys'</span><span >,</span><span style="color: rgb(170, 4, 249);">'ENTREZ_ID'</span><span >);</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >head(onmic_data)</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableTableElement" uid="76B5C8EE" data-testid="output_5" style="width: 450px;"><div class="ClientDocument veSpecifier table" id="variableeditor_client_Document_0" widgetid="variableeditor_client_Document_0" tabindex="0"><div class="summaryBar" style="font-size: 12px; font-family: Consolas, Inconsolata, Menlo, monospace;"><span>ans = </span><span style="color: rgb(179, 179, 179); font-style: normal;">8×6 table </span></div><div id="variableeditor_TableViewModel_0" widgetid="variableeditor_TableViewModel_0" class="table ClientViewDiv hasSummaryBar" data-viewid="__1"><table cellspacing="0" style="border-spacing: 0px; border-width: 0px 1px 0px 0px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><thead><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 34px; text-align: left; border-width: 1px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>&nbsp;</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 143px; min-width: 143px; max-width: 143px; text-align: center; border-width: 1px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>ENTREZ_ID_aux_table</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 80px; min-width: 80px; max-width: 80px; text-align: center; border-width: 1px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>transcript</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 150px; min-width: 150px; max-width: 150px; text-align: center; border-width: 1px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>ENTREZ_ID_onmic_data</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 98px; min-width: 98px; max-width: 98px; text-align: center; border-width: 1px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>scramble</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: center; border-width: 1px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>siRRM1</span></th><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: center; border-width: 1px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>siRRM2</span></th></tr></thead><tbody><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 34px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>1</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 143px; min-width: 143px; max-width: 143px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'100'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 80px; min-width: 80px; max-width: 80px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'100.1'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 150px; min-width: 150px; max-width: 150px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'100'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 98px; min-width: 98px; max-width: 98px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 34px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>2</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 143px; min-width: 143px; max-width: 143px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10005'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 80px; min-width: 80px; max-width: 80px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10005.1'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 150px; min-width: 150px; max-width: 150px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10005'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 98px; min-width: 98px; max-width: 98px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 34px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>3</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 143px; min-width: 143px; max-width: 143px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10005'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 80px; min-width: 80px; max-width: 80px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10005.2'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 150px; min-width: 150px; max-width: 150px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10005'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 98px; min-width: 98px; max-width: 98px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 34px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>4</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 143px; min-width: 143px; max-width: 143px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10005'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 80px; min-width: 80px; max-width: 80px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10005.3'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 150px; min-width: 150px; max-width: 150px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10005'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 98px; min-width: 98px; max-width: 98px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 34px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>5</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 143px; min-width: 143px; max-width: 143px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10007'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 80px; min-width: 80px; max-width: 80px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10007.1'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 150px; min-width: 150px; max-width: 150px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10007'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 98px; min-width: 98px; max-width: 98px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 34px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>6</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 143px; min-width: 143px; max-width: 143px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10020'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 80px; min-width: 80px; max-width: 80px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10020.1'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 150px; min-width: 150px; max-width: 150px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10020'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 98px; min-width: 98px; max-width: 98px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 34px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>7</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 143px; min-width: 143px; max-width: 143px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10026'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 80px; min-width: 80px; max-width: 80px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10026.1'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 150px; min-width: 150px; max-width: 150px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10026'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 98px; min-width: 98px; max-width: 98px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>0</span></td></tr><tr><th style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 9px; overflow: hidden; width: 34px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial; background: rgb(245, 245, 245); color: rgb(128, 128, 128); padding: 3px;"><span>8</span></th><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 143px; min-width: 143px; max-width: 143px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10050'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 80px; min-width: 80px; max-width: 80px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10050.1'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 150px; min-width: 150px; max-width: 150px; text-align: left; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>'10050'</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 98px; min-width: 98px; max-width: 98px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>-1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>-1</span></td><td style="text-overflow: ellipsis; font-family: Arial, sans-serif; font-size: 12px; overflow: hidden; width: 83px; min-width: 83px; max-width: 83px; text-align: right; border-width: 0px 0px 1px 1px; border-style: solid; border-color: rgb(191, 191, 191); border-image: initial;"><span>-1</span></td></tr></tbody></table></div></div></div></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% prepare data for iMAT algorithm</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >expressionData = struct();</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >expressionData.gene = onmic_data.transcript;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >expressionData.value = onmic_data.scramble*2;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >[onmic_rxn_data.expression, onmic_rxn_data.parsedGPR] = mapExpressionToReactions(model, expressionData);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >onmic_rxn_data.expression(onmic_rxn_data.expression == -1) = 0; </span><span style="color: rgb(2, 128, 9);">% not mapped reactions as 0 (medium expressed = No information)</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'\tOmnic data transformed from gene level to reaction level\n'</span><span >);</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="AAC07B24" data-testid="output_6" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">	Omnic data transformed from gene level to reaction level</div></div></div></div></div><div  class = 'S2'><span>In the original formulation of the paper and in our implementation, the algorithm selected for tissue reconstruction is iMAT. iMAT is computationally expensive and it's solution is not unique, so we provide the result of iMAT implementation.</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% code for iMAT solver</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >options  =struct();</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >options.solver = </span><span style="color: rgb(170, 4, 249);">'iMAT'</span><span >;   </span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >options.threshold_lb = + 1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >options.threshold_ub = - 1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >options.expressionRxns = onmic_rxn_data.expression;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >options.timelimit = 30;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >options.printLevel = 1;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >options.numWorkers = 2;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >options.numThreads = 2;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% run iMAT</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >tic</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%tissueModel_scramble = createTissueSpecificModel(model, options, 1);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >load([</span><span style="color: rgb(170, 4, 249);">'Data' </span><span >filesep </span><span style="color: rgb(170, 4, 249);">'tissueModel_scramble.mat'</span><span >])</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >TIME.iMAT = toc    </span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="D4CE3345" data-testid="output_7" data-width="420" data-height="34" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">TIME = <span class="headerElement" style="white-space: normal; font-style: italic; color: rgb(179, 179, 179); font-size: 12px;">struct with fields:</span></span></div><div style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">    iMAT: 0.0792
</div></div></div></div></div></div><div  class = 'S2'><span>The reconstructed model is sampled to obtain 2000 possible flux states, which can define a reference flux state. Sampling is computationaly expensive and stocastic, so we provide the solution of the article</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Sampling Method and options</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >sampling_method = </span><span style="color: rgb(170, 4, 249);">'ACHR'</span><span >;	</span><span style="color: rgb(2, 128, 9);">%{('CHRR'), 'ACHR'}</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >sampling_options = struct();</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >sampling_options.nWarmupPoints = 5000;      	</span><span style="color: rgb(2, 128, 9);">% (default)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >sampling_options.nPointsReturned  = 2000;   	</span><span style="color: rgb(2, 128, 9);">% (default)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >sampling_options.nStepsPerPoint  = 500;    	</span><span style="color: rgb(2, 128, 9);">% (default = 200)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Now COBRAtoolbox include sampler</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >tic</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%[modelSampling,samples] = sampleCbModel(tissueModel_scramble,'sampleFiles',sampling_method,sampling_options);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >load([</span><span style="color: rgb(170, 4, 249);">'Data' </span><span >filesep </span><span style="color: rgb(170, 4, 249);">'Sampling_results.mat'</span><span >]);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >TIME.sampling = toc;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >sampleStats = calcSampleStats(samples);</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="DCE30395" data-testid="output_8" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">Processing sample 1</div></div></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% from reduced index to model.rxns index</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >idx = zeros(size(samples,1),1);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >i = 1:numel(idx)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">try</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        idx(i) = find(strcmp(model.rxns,modelSampling.rxns{i}));</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">catch</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        idx(i) = find(cellfun(@length,strfind(model.rxns,modelSampling.rxns{i})));</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >        sampleStats.mean(i)=-1*sampleStats.mean(i) </span><span style="color: rgb(2, 128, 9);">%Those reactions are reversed;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >rxnInactive = setdiff(1:length(model.rxns),idx); </span><span style="color: rgb(2, 128, 9);">% inactive reactions</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >fields = fieldnames(sampleStats);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">for </span><span >i = 1:numel(fields)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    aux = sampleStats.(fields{i});</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    sampleStats.(fields{i}) = zeros(size(model.rxns));</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    sampleStats.(fields{i})(idx) = aux;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    clear </span><span style="color: rgb(170, 4, 249);">aux</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(14, 0, 255);">end</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% resize the samples matrix</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >aux = samples;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >samples = zeros(size(model.rxns,1),sampling_options.nPointsReturned);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >samples (idx,:) = aux;</span></span></div></div><div class="inlineWrapper"><div  class = 'S12'><span style="white-space: normal"><span >clear </span><span style="color: rgb(170, 4, 249);">aux</span><span >;   </span></span></div></div></div><div  class = 'S8'><span>Finally we can set a reference flux</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S13'><span style="white-space: normal"><span >Vref = sampleStats.mean;</span></span></div></div></div><h2  class = 'S10'><span>STEP 2: load the information of the differentially expressed genes and calculate upregulated and downregulated reactions</span></h2><div  class = 'S2'><span>Once we have defined the source genotype, in most of the applications the disease state, we need to calculate the required changes in order to reach the objective state, in most of the cases the healthy state.</span></div><div  class = 'S2'><span>This is a particular case, in which we start in a Wild Type / scramble state (source) and try to calculate the gene Knock-out which reaches the mutant state (target). This is a controlled KO which allows us to evaluate the use of rMTA.</span></div><div  class = 'S2'><span>The differential expression of Scramble vs siRRM1 has done in R, using GEO accession tool ARIMA and limma, with the default parameters (this is explained in detail in the rMTA article in detail [2]).</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Differentially expressed genes</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Neccesary variables: 'gene','logFC','pval'</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% 'Gene_ID' must be the same nomenclature as the metabolic model</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Study must be uploaded as DISEASE VS HEALTHY/CONTROL</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >filename_differentially_expressed_genes = </span><span style="color: rgb(170, 4, 249);">'scramble-siRRM1_differ_exp_met_genes.txt'</span><span >;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >logFC_requiered = 0; </span><span style="color: rgb(2, 128, 9);">% change if necesary</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >pval_requiered = 0.1; </span><span style="color: rgb(2, 128, 9);">% change if necesary</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >differ_genes = readtable(fullfile(</span><span style="color: rgb(170, 4, 249);">'Data'</span><span >,filename_differentially_expressed_genes),</span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >    </span><span style="color: rgb(170, 4, 249);">'ReadVariableNames'</span><span >,true);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >differ_genes.pval = differ_genes.adj_P_Val; </span><span style="color: rgb(2, 128, 9);">% requiered variable by code</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >differ_genes.gene = differ_genes.ENTREZ_ID; </span><span style="color: rgb(2, 128, 9);">% requiered variable by code</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Here we should obtain an array similar to rxnHML, in which we have the</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% information of whatever an expresion should increase, decrease or nothing</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% (+1)R_f    (-1)R_b     (0)unchanged</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% This vector is called rxnFBS (Forward, Backward, Unchanged)</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >rxnFBS = diffexprs2rxnFBS(model, differ_genes, Vref, </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >    </span><span style="color: rgb(170, 4, 249);">'SeparateTranscript'</span><span >, transcript_separator, </span><span style="color: rgb(170, 4, 249);">'logFC'</span><span >, logFC_requiered, </span><span style="color: rgb(170, 4, 249);">'pval'</span><span >, pval_requiered);</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="32638DAB" data-testid="output_9" data-width="420" data-height="73" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">	Gene expression changes calculated
	There are 204 trainscripts that are differentially expressed
	There are 161 genes that are differentially expressed
	Reaction expression changes calculated
	There are 159 reactions that are differentially expressed</div></div></div></div><div class="inlineWrapper"><div  class = 'S11'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% change in rxnFBS all those reactions that are not active</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%  it is not possible to predict the direction of the change</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >rxnFBS(rxnInactive) = 0;</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >fprintf(</span><span style="color: rgb(170, 4, 249);">'\tThere are %u reactions that are differentially expressed after curation\n'</span><span >,sum(rxnFBS~=0));</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="222D913E" data-testid="output_10" data-width="420" data-height="18" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">	There are 76 reactions that are differentially expressed after curation</div></div></div></div></div><h2  class = 'S10'><span>STEP 3: run rMTA algorithm, implemented in a function available in COBRA toolbox</span></h2><div  class = 'S2'><span>Both MTA and rMTA use the same parameters: epsilon and alpha:</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Define alpha values to calculate rMTA</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >alpha_values = [0.66];  </span><span style="color: rgb(2, 128, 9);">% (default range of values) % better to have more values</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%  It has been included 0.66 as it is the original value used in the</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">%  original paper ('Yizhak et al, 2013')</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >num_alphas = length(alpha_values);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% Calculate epsilon, different for each reaction and with a minimum required change of 1e-3 (%default)</span></span></div></div><div class="inlineWrapper"><div  class = 'S12'><span style="white-space: normal"><span >epsilon = calculateEPSILON(samples, rxnFBS);</span></span></div></div></div><div  class = 'S8'><span>One we have defined the parameters required by rMTA/MTA, we can use the COBRA function to calculate the transformation score (TS score):</span></div><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S9'><span style="white-space: normal"><span >changeCobraSolver(</span><span style="color: rgb(170, 4, 249);">'ibm_cplex'</span><span >, </span><span style="color: rgb(170, 4, 249);">'all'</span><span >)</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement scrollableOutput" uid="5D3AD889" data-testid="output_11" data-width="420" data-height="241" data-hashorizontaloverflow="true" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"> &gt; changeCobraSolver: IBM ILOG CPLEX interface added to MATLAB path.
 &gt; The solver compatibility is not tested with MATLAB R2018b.
 &gt; changeCobraSolver: Solver for LP problems has been set to ibm_cplex.

 &gt; changeCobraSolver: IBM ILOG CPLEX interface added to MATLAB path.
 &gt; The solver compatibility is not tested with MATLAB R2018b.
 &gt; changeCobraSolver: Solver for MILP problems has been set to ibm_cplex.

 &gt; changeCobraSolver: IBM ILOG CPLEX interface added to MATLAB path.
 &gt; The solver compatibility is not tested with MATLAB R2018b.
 &gt; changeCobraSolver: Solver for QP problems has been set to ibm_cplex.

 &gt; changeCobraSolver: IBM ILOG CPLEX interface added to MATLAB path.
 &gt; The solver compatibility is not tested with MATLAB R2018b.
 &gt; changeCobraSolver: Solver for MIQP problems has been set to ibm_cplex.
 &gt; changeCobraSolver: Solver ibm_cplex not supported for problems of type EP. No solver set for this problemtype 
 &gt; changeCobraSolver: Solver ibm_cplex not supported for problems of type NLP. Currently used: matlab </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="C9067E3A" data-testid="output_12" data-width="420" data-height="34" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">ans = <span class="headerElement" style="white-space: normal; font-style: italic; color: rgb(179, 179, 179); font-size: 12px;">logical</span></span></div><div style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">   1
</div></div></div></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% execute the code</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >tic</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >[TSscore, deletedGenes, Vres] = rMTA(model, rxnFBS, Vref, alpha_values, epsilon, </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >    </span><span style="color: rgb(170, 4, 249);">'timelimit'</span><span >, 60, </span><span style="color: rgb(170, 4, 249);">'SeparateTranscript'</span><span >, transcript_separator, </span><span style="color: rgb(170, 4, 249);">'printLevel'</span><span >, 1);</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="8A133671" data-testid="output_13" data-width="420" data-height="437" data-hashorizontaloverflow="false" style="width: 450px; max-height: 448px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">===================================
========  rMTA algorithm  =========
===================================
Step 0: preprocessing: 
Calculate Gene Knock-out matrix
100%    [........................................]
	GeneKOMatrix calculated
-------------------
Step 1 in progress: the best scenario 
	Start rMTA best scenario case for alpha = 0.66 
	cplex model for MTA built
    MIQP Iterations for bMTA
100%    [........................................]
	All MIQP problems performed
	Step 1 time: 119.66 seconds = 1.99 minutes
-------------------
Step 2 in progress: MOMA
	QPproblem model for MOMA built
    QP Iterations for MTA
100%    [........................................]
	All MOMA problems performed
	Step 2 time: 35.68 seconds = 0.59 minutes
-------------------
Step 3 in progress: the worst scenario 
	Start rMTA worst scenario case for alpha = 0.66 
	cplex model for MTA built
    MIQP Iterations for wMTA
100%    [........................................]
	All MIQP problems performed
	Step 3 time: 120.45 seconds = 2.01 minutes
-------------------</div></div></div></div><div class="inlineWrapper outputs"><div  class = 'S14'><span style="white-space: normal"><span >TIME.rMTA = toc  </span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="D75DCA43" data-testid="output_14" data-width="420" data-height="62" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">TIME = <span class="headerElement" style="white-space: normal; font-style: italic; color: rgb(179, 179, 179); font-size: 12px;">struct with fields:</span></span></div><div style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">        iMAT: 0.0792
    sampling: 0.1070
        rMTA: 293.3228
</div></div></div></div></div></div><h2  class = 'S10'><span>STEP 4: save results in an Excel for study</span></h2><div  class = 'S2'><span>First of all, we are going to clean the Results folder and save the results from this tutorial</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span >delete([</span><span style="color: rgb(170, 4, 249);">'Results' </span><span >filesep </span><span style="color: rgb(170, 4, 249);">'H929_siRRM1_case.mat'</span><span >])</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >delete([</span><span style="color: rgb(170, 4, 249);">'Results' </span><span >filesep </span><span style="color: rgb(170, 4, 249);">'H929_siRRM1_case.xlsx'</span><span >])</span></span></div></div><div class="inlineWrapper"><div  class = 'S12'><span style="white-space: normal"><span >save([</span><span style="color: rgb(170, 4, 249);">'Results' </span><span >filesep </span><span style="color: rgb(170, 4, 249);">'H929_siRRM1_case.mat'</span><span >])</span></span></div></div></div><div  class = 'S8'><span>Secondly, we can use information from Biomart to provide additional information of the genes, like the ENSEMBL ID, gene name, symbol,...</span></div><div class="CodeBlock"><div class="inlineWrapper"><div  class = 'S4'><span style="white-space: normal"><span style="color: rgb(2, 128, 9);">% gene information</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >filename3 = </span><span style="color: rgb(170, 4, 249);">'Data\GeneInfo_HomoSapiens_ENSEMBL_103.txt'</span><span >;</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >biomart_genes = readtable(filename3,</span><span style="color: rgb(170, 4, 249);">'ReadVariableNames'</span><span >,true);</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="B7C6D43B" data-testid="output_15" data-width="420" data-height="44" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Variable names were modified to make them valid MATLAB identifiers. The original names are saved in the VariableDescriptions property.</div><div class="diagnosticMessage-stackPart" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div></div></div><div class="inlineWrapper"><div  class = 'S11'><span style="white-space: normal"><span >biomart_genes.NCBIGene_formerlyEntrezgene_ID = cellfun(@num2str, num2cell(biomart_genes.NCBIGene_formerlyEntrezgene_ID), </span><span style="color: rgb(170, 4, 249);">'UniformOutput'</span><span >, 0);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >[~, idx] = ismember(deletedGenes, biomart_genes.NCBIGene_formerlyEntrezgene_ID);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >idx = idx (idx&gt;0);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >gene_info = biomart_genes(idx,:);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >gene_info.gene = gene_info.NCBIGene_formerlyEntrezgene_ID;</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >geneID=table(deletedGenes, </span><span style="color: rgb(170, 4, 249);">'VariableNames'</span><span >, {</span><span style="color: rgb(170, 4, 249);">'gene'</span><span >});</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >gene_info = outerjoin(geneID,gene_info,</span><span style="color: rgb(170, 4, 249);">'MergeKeys'</span><span >,true);</span></span></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'></div></div><div class="inlineWrapper"><div  class = 'S5'><span style="white-space: normal"><span >rMTAsaveInExcel([</span><span style="color: rgb(170, 4, 249);">'Results' </span><span >filesep </span><span style="color: rgb(170, 4, 249);">'H929_siRRM1_case.xlsx'</span><span >], TSscore, deletedGenes, alpha_values, </span><span style="color: rgb(14, 0, 255);">...</span></span></div></div><div class="inlineWrapper outputs"><div  class = 'S6'><span style="white-space: normal"><span >    </span><span style="color: rgb(170, 4, 249);">'differ_genes'</span><span >, differ_genes,</span><span style="color: rgb(170, 4, 249);">'gene_info'</span><span >, gene_info, </span><span style="color: rgb(170, 4, 249);">'RankingGeneID' </span><span >,</span><span style="color: rgb(170, 4, 249);">'6240'</span><span >)</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="82C33C28" data-testid="output_16" data-width="420" data-height="45" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">	Process results for alpha = 0.66 
	Selected the "550" best solutions
	Write xls for alpha = 0.66 </div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="6343AF30" data-testid="output_17" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Added specified worksheet.</div><div class="diagnosticMessage-stackPart" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="9FB6926D" data-testid="output_18" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">	Write selection of best genes</div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="22B0978D" data-testid="output_19" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Added specified worksheet.</div><div class="diagnosticMessage-stackPart" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="045FDF95" data-testid="output_20" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Added specified worksheet.</div><div class="diagnosticMessage-stackPart" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="8A3AD638" data-testid="output_21" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">	SUMMARY</div></div><div class="inlineElement eoOutputWrapper embeddedOutputsWarningElement" uid="583FD288" data-testid="output_22" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="diagnosticMessage-wrapper diagnosticMessage-warningType" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"><div class="diagnosticMessage-messagePart" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;">Warning: Added specified worksheet.</div><div class="diagnosticMessage-stackPart" style="white-space: normal; font-style: normal; color: rgb(255, 100, 0); font-size: 12px;"></div></div></div><div class="inlineElement eoOutputWrapper embeddedOutputsTextElement" uid="A9AB8EDF" data-testid="output_23" data-width="420" data-height="18" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">DONE</div></div></div></div></div><div  class = 'S8'><span></span></div><div  class = 'S2'><span>Obtained results should show that RRM1 has been predicted number 28 in the ranking, using an alpha of 0.66</span></div><div  class = 'S2'><img class = "imageNode" src = "" width = "768" height = "670" alt = "" style = "vertical-align: baseline"></img></div><h2  class = 'S10'><span>TIMING</span></h2><ol  class = 'S15'><li  class = 'S16'><span>Equipment Setup: ~25 sec.</span></li><li  class = 'S16'><span>Load the information and process it: ~5 sec.</span></li><li  class = 'S16'><span>Reconstruction: ~1-5 min.</span></li><li  class = 'S16'><span>Sampling: ~15 min.</span></li><li  class = 'S16'><span>rMTA: ~5 min </span></li></ol><div class="CodeBlock"><div class="inlineWrapper outputs"><div  class = 'S9'><span style="white-space: normal"><span > TIME</span></span></div><div  class = 'S7'><div class="inlineElement eoOutputWrapper embeddedOutputsVariableStringElement" uid="8B27C2C0" data-testid="output_24" data-width="420" data-height="62" data-hashorizontaloverflow="false" style="width: 450px; max-height: 261px; white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div class="textElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><div style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;"><span class="variableNameElement" style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">TIME = <span class="headerElement" style="white-space: normal; font-style: italic; color: rgb(179, 179, 179); font-size: 12px;">struct with fields:</span></span></div><div style="white-space: normal; font-style: normal; color: rgb(64, 64, 64); font-size: 12px;">        iMAT: 0.0792
    sampling: 0.1070
        rMTA: 293.3228
</div></div></div></div></div></div><div  class = 'S8'><span>Note that it is advisable to have EXCEL installed, in order to save all the results in an easily understandable format.</span></div><h2  class = 'S10'><span>REFERENCES</span></h2><div  class = 'S2'><span style=' font-style: italic;'>1. </span><span>Yizhak, Keren, et al. "Model-based identification of drug targets that  revert disrupted metabolism and its application to ageing." </span><span style=' font-style: italic;'>Nature communications</span><span> 4.1 (2013): 1-11.</span></div><div  class = 'S2'><span style=' font-style: italic;'>2. </span><span>Valcárcel, Luis V., et al. "rMTA: robust metabolic transformation analysis." </span><span style=' font-style: italic;'>Bioinformatics</span><span> 35.21 (2019): 4350-4355.</span></div><div  class = 'S2'><span style=' font-style: italic;'>3. </span><span>Sagawa, Morihiko, et al. "Ribonucleotide reductase catalytic subunit M1  (RRM1) as a novel therapeutic target in multiple myeloma." </span><span style=' font-style: italic;'>Clinical Cancer Research</span><span> 23.17 (2017): 5225-5237.</span></div><div  class = 'S2'><span style=' font-style: italic;'>4. </span><span>Shlomi, Tomer, et al. "Network-based prediction of human tissue-specific metabolism." </span><span style=' font-style: italic;'>Nature biotechnology</span><span> 26.9 (2008): 1003-1010.</span></div><div  class = 'S2'></div>
<br>
<!-- 
##### SOURCE BEGIN #####
%% *Robust Metabolic Transformation Analysis - rMTA*
%% Luis V. Valcarcel, University of Navarra, TECNUN School of Engineering, Spain
%% Francisco J. Planes, University of Navarra, TECNUN School of Engineering, Spain
%% Reviewer(s): 
%% INTRODUCTION
% Metabolic Transformation Algorithm (MTA) [1] aims to identify targets that 
% transform a disease metabolic state back  into a healthy state, with potential 
% application in any disease where a  clear metabolic alteration is observed.
% 
% Robust Metabolic Transformation Algorithm (rMTA) [2] is the natural evolution 
% of such an algorithm, removing the induced bias and studying all the possible 
% outputs of metabolic perturbations; to discover how easy is for a perturbation 
% to drive the metabolism into target or in the opposite direction. This can be 
% seen in Figure 1. Our desired case is (*Figure 1A*), in which MTA  and MTA targeting 
% the opposte direction can only drive the metabolism into the desired direction. 
% This is produced when the Transformation Scores (TSs) after gene knockout are 
% skewed to the healthy direction in both the best-case (bTS) and worst-case scenario 
% (wTS); (*Figure 1B*) TSs are similar in value and skewed to the opposite direction 
% in the best-case and worst-case scenario and, therefore, under-determination 
% arises; (*Figure 1C*) The same as (*Figure 1B*), but TS is higher in the best-case 
% scenario and skewed to the healthy direction when MOMA is applied (mTS > 0). 
% Under-determination is resolved here using mTS (MOMA TS), which generates the 
% perturbation without any prior knowledge of the desired flux change direction.
% 
% 
% 
% *Figure 1. Illustration of the problem addressed by rMTA*. 
% 
% In order to show the use of the tool, we are going to use data from controlled 
% gene knockout (_RRM1_) experiment in a human cell line with RPMI cultture media. 
% The experiment reference is GSE9345 [3]. In such experiment, we are going to 
% predict that _RRM1_ drives the source state(WT) into the target (RRM1-knockout) 
% state. This case is shown in table 2 of the rMTA article.
%% EQUIPMENT SETUP
%% Initialize The Cobra Toolbox and select the solver (~25 sec)
% If necessary, initialise the Cobra Toolbox:

clear

initCobraToolbox(false) % false, as we don't want to update
%% 
% Note that the approaches to calculate MTA and rMTA scores it is necessary 
% to solve problems that are based on Mixed Integer Quadratic Programming (MIQP). 
% The solver selected will be Cplex, althought it has also been tested with gurobi.

changeCobraSolver('ibm_cplex', 'all');
%% STEP 1: load the information to generate the reference flux
% The first step of rMTA algorithm is the reconstruction of the model for a 
% specific tissue and sample the feasible flux space to calculate a reference 
% flux. 
% 
% For this study we have used Recon1, using the RPMI-1640 culture media. We 
% have used FVA to find all blocked reactions and remove them.

filename_metabolic_model = 'Recon1_RPMI1640_FVA.mat';
model = readCbModel(fullfile('Data',filename_metabolic_model))

% transcript separator: there are some models (as Recon X) in which genes are
% used at transcript level, not in gene level. Transcript separator is a variable
% to join all transcripts of the gene and work at gene level.
transcript_separator = '.';

fprintf('\tMetabolic model uploaded\n');
%% 
% Then we import the gene expression data and reconstruct the model, using iMAT. 
% This data has been obtaind in R using GEO accesion tools and performing the 
% data preprocessing proposed for the Affymetrix Human Genome U133A 2.0 Array, 
% using ARIMA, and the discretization into Highly , medium or lowly expressed 
% proposed by the authors of iMAT[4]. This is explained in detail in the rMTA 
% article in detail [2].

filename_onmics = 'GSE93425_Recon1_discret_iMAT_07_100.txt';
onmic_data = readtable(['Data',filesep,filename_onmics],'ReadVariableNames',true);

% Traduce onmic data from gene level to reaction level
aux_table = table(strtok(model.genes,transcript_separator),model.genes,'VariableNames',{'ENTREZ_ID' 'transcript'});
onmic_data = outerjoin(aux_table, onmic_data, 'Keys','ENTREZ_ID');
head(onmic_data)
% prepare data for iMAT algorithm
expressionData = struct();
expressionData.gene = onmic_data.transcript;
expressionData.value = onmic_data.scramble*2;
[onmic_rxn_data.expression, onmic_rxn_data.parsedGPR] = mapExpressionToReactions(model, expressionData);
onmic_rxn_data.expression(onmic_rxn_data.expression == -1) = 0; % not mapped reactions as 0 (medium expressed = No information)
fprintf('\tOmnic data transformed from gene level to reaction level\n');
%% 
% In the original formulation of the paper and in our implementation, the algorithm 
% selected for tissue reconstruction is iMAT. iMAT is computationally expensive 
% and it's solution is not unique, so we provide the result of iMAT implementation.

% code for iMAT solver
options  =struct();
options.solver = 'iMAT';   
options.threshold_lb = + 1;
options.threshold_ub = - 1;
options.expressionRxns = onmic_rxn_data.expression;
options.timelimit = 30;
options.printLevel = 1;
options.numWorkers = 2;
options.numThreads = 2;

% run iMAT
tic
%tissueModel_scramble = createTissueSpecificModel(model, options, 1);
load(['Data' filesep 'tissueModel_scramble.mat'])
TIME.iMAT = toc    
%% 
% The reconstructed model is sampled to obtain 2000 possible flux states, which 
% can define a reference flux state. Sampling is computationaly expensive and 
% stocastic, so we provide the solution of the article

% Sampling Method and options
sampling_method = 'ACHR';	%{('CHRR'), 'ACHR'}
sampling_options = struct();
sampling_options.nWarmupPoints = 5000;      	% (default)
sampling_options.nPointsReturned  = 2000;   	% (default)
sampling_options.nStepsPerPoint  = 500;    	% (default = 200)

% Now COBRAtoolbox include sampler
tic
%[modelSampling,samples] = sampleCbModel(tissueModel_scramble,'sampleFiles',sampling_method,sampling_options);
load(['Data' filesep 'Sampling_results.mat']);
TIME.sampling = toc;

sampleStats = calcSampleStats(samples);
% from reduced index to model.rxns index
idx = zeros(size(samples,1),1);
for i = 1:numel(idx)
    try
        idx(i) = find(strcmp(model.rxns,modelSampling.rxns{i}));
    catch
        idx(i) = find(cellfun(@length,strfind(model.rxns,modelSampling.rxns{i})));
        sampleStats.mean(i)=-1*sampleStats.mean(i) %Those reactions are reversed;
    end
end
rxnInactive = setdiff(1:length(model.rxns),idx); % inactive reactions
fields = fieldnames(sampleStats);
for i = 1:numel(fields)
    aux = sampleStats.(fields{i});
    sampleStats.(fields{i}) = zeros(size(model.rxns));
    sampleStats.(fields{i})(idx) = aux;
    clear aux
end

% resize the samples matrix
aux = samples;
samples = zeros(size(model.rxns,1),sampling_options.nPointsReturned);
samples (idx,:) = aux;
clear aux;   
%% 
% Finally we can set a reference flux

Vref = sampleStats.mean;
%% STEP 2: load the information of the differentially expressed genes and calculate upregulated and downregulated reactions
% Once we have defined the source genotype, in most of the applications the 
% disease state, we need to calculate the required changes in order to reach the 
% objective state, in most of the cases the healthy state.
% 
% This is a particular case, in which we start in a Wild Type / scramble state 
% (source) and try to calculate the gene Knock-out which reaches the mutant state 
% (target). This is a controlled KO which allows us to evaluate the use of rMTA.
% 
% The differential expression of Scramble vs siRRM1 has done in R, using GEO 
% accession tool ARIMA and limma, with the default parameters (this is explained 
% in detail in the rMTA article in detail [2]).

% Differentially expressed genes
% Neccesary variables: 'gene','logFC','pval'
% 'Gene_ID' must be the same nomenclature as the metabolic model
% Study must be uploaded as DISEASE VS HEALTHY/CONTROL
filename_differentially_expressed_genes = 'scramble-siRRM1_differ_exp_met_genes.txt';
logFC_requiered = 0; % change if necesary
pval_requiered = 0.1; % change if necesary

differ_genes = readtable(fullfile('Data',filename_differentially_expressed_genes),...
    'ReadVariableNames',true);

differ_genes.pval = differ_genes.adj_P_Val; % requiered variable by code
differ_genes.gene = differ_genes.ENTREZ_ID; % requiered variable by code

% Here we should obtain an array similar to rxnHML, in which we have the
% information of whatever an expresion should increase, decrease or nothing
% (+1)R_f    (-1)R_b     (0)unchanged
% This vector is called rxnFBS (Forward, Backward, Unchanged)

rxnFBS = diffexprs2rxnFBS(model, differ_genes, Vref, ...
    'SeparateTranscript', transcript_separator, 'logFC', logFC_requiered, 'pval', pval_requiered);

% change in rxnFBS all those reactions that are not active
%  it is not possible to predict the direction of the change
rxnFBS(rxnInactive) = 0;
fprintf('\tThere are %u reactions that are differentially expressed after curation\n',sum(rxnFBS~=0));
%% STEP 3: run rMTA algorithm, implemented in a function available in COBRA toolbox
% Both MTA and rMTA use the same parameters: epsilon and alpha:

% Define alpha values to calculate rMTA
alpha_values = [0.66];  % (default range of values) % better to have more values
%  It has been included 0.66 as it is the original value used in the
%  original paper ('Yizhak et al, 2013')
num_alphas = length(alpha_values);

% Calculate epsilon, different for each reaction and with a minimum required change of 1e-3 (%default)
epsilon = calculateEPSILON(samples, rxnFBS);
%% 
% One we have defined the parameters required by rMTA/MTA, we can use the COBRA 
% function to calculate the transformation score (TS score):

changeCobraSolver('ibm_cplex', 'all')
% execute the code
tic
[TSscore, deletedGenes, Vres] = rMTA(model, rxnFBS, Vref, alpha_values, epsilon, ...
    'timelimit', 60, 'SeparateTranscript', transcript_separator, 'printLevel', 1);
TIME.rMTA = toc  
%% STEP 4: save results in an Excel for study
% First of all, we are going to clean the Results folder and save the results 
% from this tutorial

delete(['Results' filesep 'H929_siRRM1_case.mat'])
delete(['Results' filesep 'H929_siRRM1_case.xlsx'])
save(['Results' filesep 'H929_siRRM1_case.mat'])
%% 
% Secondly, we can use information from Biomart to provide additional information 
% of the genes, like the ENSEMBL ID, gene name, symbol,...

% gene information
filename3 = 'Data\GeneInfo_HomoSapiens_ENSEMBL_103.txt';
biomart_genes = readtable(filename3,'ReadVariableNames',true);
biomart_genes.NCBIGene_formerlyEntrezgene_ID = cellfun(@num2str, num2cell(biomart_genes.NCBIGene_formerlyEntrezgene_ID), 'UniformOutput', 0);
[~, idx] = ismember(deletedGenes, biomart_genes.NCBIGene_formerlyEntrezgene_ID);
idx = idx (idx>0);
gene_info = biomart_genes(idx,:);
gene_info.gene = gene_info.NCBIGene_formerlyEntrezgene_ID;
geneID=table(deletedGenes, 'VariableNames', {'gene'});
gene_info = outerjoin(geneID,gene_info,'MergeKeys',true);


rMTAsaveInExcel(['Results' filesep 'H929_siRRM1_case.xlsx'], TSscore, deletedGenes, alpha_values, ...
    'differ_genes', differ_genes,'gene_info', gene_info, 'RankingGeneID' ,'6240')
%% 
% 
% 
% Obtained results should show that RRM1 has been predicted number 28 in the 
% ranking, using an alpha of 0.66
% 
% 
%% TIMING
%% 
% # Equipment Setup: ~25 sec.
% # Load the information and process it: ~5 sec.
% # Reconstruction: ~1-5 min.
% # Sampling: ~15 min.
% # rMTA: ~5 min 

 TIME
%% 
% Note that it is advisable to have EXCEL installed, in order to save all the 
% results in an easily understandable format.
%% REFERENCES
% _1._ Yizhak, Keren, et al. "Model-based identification of drug targets that  
% revert disrupted metabolism and its application to ageing." _Nature communications_ 
% 4.1 (2013): 1-11.
% 
% _2._ Valcárcel, Luis V., et al. "rMTA: robust metabolic transformation analysis." 
% _Bioinformatics_ 35.21 (2019): 4350-4355.
% 
% _3._ Sagawa, Morihiko, et al. "Ribonucleotide reductase catalytic subunit 
% M1  (RRM1) as a novel therapeutic target in multiple myeloma." _Clinical Cancer 
% Research_ 23.17 (2017): 5225-5237.
% 
% _4._ Shlomi, Tomer, et al. "Network-based prediction of human tissue-specific 
% metabolism." _Nature biotechnology_ 26.9 (2008): 1003-1010.
% 
%
##### SOURCE END #####
-->
</div></body></html>